package com.weigee.ktv.view.fragment

import android.os.Bundle
import android.view.LayoutInflater
import android.view.View
import android.view.ViewGroup
import com.linde.library.activities.MyFragmentActivity
import com.linde.library.util.DisplayUtil
import com.linde.library.util.ToastUtil
import com.weigee.ktv.R
import com.weigee.ktv.view.activity.PayingActivity
import kotlinx.android.synthetic.main.frag_wallet.*
import kotlinx.android.synthetic.main.include_status_bar_height.*
import kotlinx.android.synthetic.main.include_title_bar.*

/**
 * Created by linde on 2017/6/7.
 * LinDe
 */
class WalletFragment : BaseFragment()
{
    override fun onCreateView(inflater: LayoutInflater?, container: ViewGroup?, savedInstanceState: Bundle?): View?
    {
        return inflater?.inflate(R.layout.frag_wallet, container, false)
    }

    override fun onViewCreated(view: View?, savedInstanceState: Bundle?)
    {
        super.onViewCreated(view, savedInstanceState)
        DisplayUtil.setStatusBarHeight(linear_status_bar_height)

        // 返回键
        my_title_bar?.leftIconClickBack = activity
        // 标题
        my_title_bar?.title = "我的钱包"
        // 点击事件...
        // 充值返利
        tv_recharge_return?.setOnClickListener {
            MyFragmentActivity.start(activity, RechargeReturnFragment::class.java)
        }
        // 付款
        tv_payed?.setOnClickListener {
            MyFragmentActivity.start(PayingActivity::class.java, activity, PayingFragment::class.java)
        }
        // 交易记录
        tv_payed_history?.setOnClickListener { v -> ToastUtil.show(v, "交易记录") }
        // 安全设置
        tv_safety_settings?.setOnClickListener {
            MyFragmentActivity.start(activity, WalletSafetySettingsFragment::class.java)
        }
    }
}